# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-exceptiongroup
_pyname=${pkgname#python-}
pkgver=1.2.2
pkgrel=3
pkgdesc='Backport of PEP 654 (exception groups).'
arch=('any')
url='https://github.com/agronholm/exceptiongroup'
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-flit-scm')
source=("https://github.com/agronholm/exceptiongroup/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('784542c457ad76579b2e2b3e816e1347020f89a33991cdce9c0dde490af9599aaa4c37368023a123483f73b33bba70d1df787799257d0ef7ba34a8219ba82237')

build() {
	cd "$_pyname-$pkgver"

	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

  python -m build -wn
}

package() {
	cd "$_pyname-$pkgver"

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}

